home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / satellit / vstsrc / vstdefs.h < prev    next >
C/C++ Source or Header  |  1995-01-30  |  11KB  |  223 lines

  1. #ifndef _VSTDEFS_H
  2. #define _VSTDEFS_H
  3. /*
  4.  * %W% %E% %U%  [EXTREL_1.2]
  5.  *
  6.  * VersaTrack orbit calculations are based on those that appear in Dr. Manfred
  7.  * Bester's sattrack program (the Unix(tm) versions 1 and 2).
  8.  *
  9.  * The data from which the maps where generated come from "xsat", an
  10.  * X-Windows program by David A. Curry (N9MSW).
  11.  *
  12.  * Site coordinates come from various sources, including a couple of
  13.  * World Almanacs, and also from both of the programs mentioned above.
  14.  *
  15.  * The following are authors' applicable copyright notices:
  16.  *
  17.  *                                                                               
  18.  * Copyright (c) 1992, 1993, 1994 Manfred Bester. All Rights Reserved.        
  19.  *                                                                           
  20.  * Permission to use, copy, modify, and distribute this software and its      
  21.  * documentation for educational, research and non-profit purposes, without   
  22.  * fee, and without a written agreement is hereby granted, provided that the  
  23.  * above copyright notice and the following three paragraphs appear in all    
  24.  * copies.                                                                    
  25.  *                                                                              
  26.  * Permission to incorporate this software into commercial products may be    
  27.  * obtained from the author, Dr. Manfred Bester, 1636 M. L. King Jr. Way,     
  28.  * Berkeley, CA 94709, USA.                                                   
  29.  *                                                                             
  30.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,  
  31.  * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF    
  32.  * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED   
  33.  * OF THE POSSIBILITY OF SUCH DAMAGE.                                         
  34.  *                                                                             
  35.  * THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT       
  36.  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A    
  37.  * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"       
  38.  * BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,  
  39.  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.                                   
  40.  *                                                                             
  41.  *                                                                             
  42.  * Copyright 1992 by David A. Curry                                            
  43.  *                                                                             
  44.  * Permission to use, copy, modify, distribute, and sell this software and its 
  45.  * documentation for any purpose is hereby granted without fee, provided that  
  46.  * the above copyright notice appear in all copies and that both that copyright
  47.  * notice and this permission notice appear in supporting documentation.  The  
  48.  * author makes no representations about the suitability of this software for  
  49.  * any purpose.  It is provided "as is" without express or implied warranty.   
  50.  *                                                                             
  51.  * David A. Curry, N9MSW                                                       
  52.  * Purdue University                                                           
  53.  * Engineering Computer Network                                                
  54.  * 1285 Electrical Engineering Building                                        
  55.  * West Lafayette, IN 47907                                                    
  56.  * davy@ecn.purdue.edu                                                         
  57.  *                                                                             
  58.  * VersaTrack Copyright (c) 1993, 1994 Siamack Navabpour. All Rights Reserved.
  59.  *
  60.  * Permission is hereby granted to copy, modify and distribute VersaTrack
  61.  * in whole, or in part, for educational, non-profit and non-commercial use
  62.  * only, free of charge or obligation, and without agreement, provided that
  63.  * all copyrights and restrictions noted herein are observed and followed, and
  64.  * additionally, that this and all other copyright notices listed herein
  65.  * appear unaltered in all copies and in all derived work.
  66.  *
  67.  * This notice shall not in any way void or supersede any of the other authors
  68.  * rights or privileges.
  69.  *
  70.  * VersaTrack IS PRESENTED FREE AND "AS IS", WITHOUT ANY WARRANTY OR SUPPORT.
  71.  * YOU USE IT AT YOUR OWN RISK. The author(s) shall not be liable for any
  72.  * direct, indirect, incidental, or consequential damage, loss of profits or
  73.  * other tangible or intangible losses or benefits, arising out of or related
  74.  * to its use. VersaTrack carries no warranty, explicit or implied, including
  75.  * but not limited to those of merchantablity and fitness for a particular
  76.  * purpose.
  77.  *
  78.  * Siamack Navabpour, 12342 Hunter's Chase Dr. Apt. 2114, Austin, TX 78729.
  79.  * sia@bga.com or sia@realtime.com.
  80.  */
  81.  
  82.  
  83. #pragma check_stack(off)
  84.  
  85. #define VSTVERSION      12            /* Ver major * 10 + ver minor */
  86. #define VERDATE         "101094"      /* Ver Date */
  87.  
  88. #define BUFLEN          200
  89. #define NAMELEN            32              /* length of file 'names' + 1 */
  90. #define NOVISCIR                      /* DOES NOT WORK YET - DONT DEFINE */
  91. #undef  WARNBEEP
  92.  
  93. #define PENWIDTH        1
  94. #define MAXX_WORLD      360           /* from -180 deg W to +180 deg E */
  95. #define MAXY_WORLD      180           /* from North Pole to South Pole */
  96. #define CWHITE          CWhite
  97. #define CBLACK          CBlack
  98. #define DEFFG           DefFg
  99. #define DEFBG           DefBg
  100. #define NPAL            16
  101.  
  102. #define IDT_TIMERBASE   12001
  103. #define IDT_ANSWER      (IDT_TIMERBASE+0)
  104. #define IDT_CURRTIME    (IDT_TIMERBASE+1)
  105. /*
  106.  * NOTE: DO NOT ALLOCATE TIMER IDs after IDT_INVBASE,
  107.  * Instead, take one in range [IDT_CURRTIME+1 .. IDT_CURTIME+IDX_NRESERVED]
  108.  */
  109. #define IDX_NRESERVED   90
  110. #define IDT_RTDBASE     (IDT_CURRTIME+IDX_NRESERVED+1)
  111.  
  112. #define ANSWER_TIME     900000
  113. #define RTD_SLEEPTIME   600
  114.  
  115. #define VST_WM                      (WM_USER+8)
  116. #define RTD_UPDATE                  (VST_WM +  1)
  117. #define EXTM_THEXIT                 (VST_WM +  2)
  118. #define RTD_WINEXIT                 (VST_WM +  3)
  119. #define RTD_THDEXIT                 (VST_WM +  4)
  120. #define RTD_STOPPED                 (VST_WM +  5)
  121. #define RTD_ALL_THREADS_STOPPED     (VST_WM +  6)
  122. #define RTD_ALL_THREADS_FINISHED    (VST_WM +  7)
  123. #define RTD_WRUNNING                (VST_WM +  8)
  124. #define RTD_TRUNNING                (VST_WM +  9)
  125. #define RTD_DRAWSAT                 (VST_WM + 10)
  126. #define RTD_LONGBEEPDOWN            (VST_WM + 11)
  127. #define RTD_LONGBEEPUP              (VST_WM + 12)
  128. #define GTR_QUIT                    (VST_WM + 13)
  129. #define RST_UPDATE                  (VST_WM + 14)
  130. #define RTD_TOGGLE_ICON             (VST_WM + 15)
  131. #define RTD_WARNBEEP                (VST_WM + 16)
  132. #define RTD_STATE                   (VST_WM + 17)
  133. #define CNTRL_SERVEXIT              (VST_WM + 18)
  134. #define VST_NOP                     (VST_WM + 19)
  135. #define RTD_DORESUME                (VST_WM + 20)
  136.  
  137. /* Server states and server thread format proc flags */
  138. #define SRV_RADIO       0   /* index into serverInfo */
  139. #define SRV_ROTATOR     1   /* index into serverInfo */
  140. #define SRV_NUM         2   /* max number of servers */
  141.  
  142. #define ST_SRV_NONE     0   /* server not invoked */
  143. #define ST_SRV_RUNNING  1   /* server invoked and apparently running */
  144.  
  145. #define FMT_INIT        0 
  146. #define FMT_FMT         1
  147. #define FMT_STOP        2
  148. #define FMT_ERROR       3
  149.  
  150. /* Delayed Operations */
  151. #define PEND_NONE               0
  152. #define PEND_DRAWMAP            1
  153. #define PEND_EXITPROGRAM        2
  154. #define PEND_DURATION_PREDICT   3
  155.  
  156. #undef  ABS
  157. #define ABS(x)      (((x) < 0) ? (-(x)) : (x) )
  158. #undef  MIN
  159. #define MIN(x,y)    (((x) < (y)) ? (x) : (y))
  160. #undef  MAX
  161. #define MAX(x,y)    (((x) > (y)) ? (x) : (y))
  162.  
  163. /*
  164.  * values for flags member of select_t
  165.  */
  166.  
  167. #define SE_RTD_BOA            1           /* blink icon on approach */
  168. #define SE_RTD_BEEP           2           /* beep on approach */
  169. #define SE_RTD_POA            4           /* pop icon on approach */
  170. #define SE_RTD_BMP            8           /* blink sat position on map */
  171. #define SE_RTD_UTC         0x10           /* display time in utc */
  172. #define SE_RTD_SLT         0x20           /* display time in site local time */
  173. #define SE_RTD_LOC         0x40           /* display time in local time */
  174. #define SE_RTD_MILE        0x80           /* display distances in miles */
  175. #define SE_RTD_KM         0x100           /* display distances in Km's */
  176. #define SE_RTD_DIC        0x200           /* state of dialog box */
  177. #define SE_RTD_ICONIC     0x400           /* display dialogbox in this state */
  178. #define SE_GTR_UTC        0x800           /* Ground Track time is UTC */
  179. #define SE_GTR_SLT       0x1000           /* Ground Track time is Site Local */
  180. #define SE_GTR_LOC       0x2000           /* Ground Track time is current local */
  181. #define SE_RTD_SIM       0x4000           /* simulated time intervals */
  182. #define SE_THSTOP        0x8000           /* command to stop the thread */
  183. #define SE_THSTOPPED    0x10000           /* acknowledge by thread */
  184. #define SE_WNDISICON    0x20000           /* current state of rtd dlg box */
  185. #define SE_STATE        0x40000           /* state changing */
  186. #define SE_RTD_HIC      0x80000           /* hide while iconic */
  187. #define SE_RFU_RFU0       0x100000              /* Reserved */
  188. #define SE_RFU_RFU1       0x200000              /* Reserved */
  189. #define SE_RTD_USERA   0x400000              /* user-a */
  190. #define SE_RTD_USERB   0x800000              /* user-b */
  191.  
  192. /*
  193.  * values for flags member of satellite_t
  194.  */
  195. #define SF_DISP         0x1         /* satellite is already being displayed */
  196. #define SF_GEOSTAT      0x2         /* satellite is in geostationary orbit */
  197. #define SF_GEOSYNC      0x4         /* satellite is in geosynchronous orbit */
  198. #define SF_ATTITUDE     0x8         /* Blat/Blon is specified for satellite */
  199.  
  200. #undef ASSERT
  201. #ifdef  _DEBUG_
  202. #define ASSERT(e)   (void)_vst_assert_(!((BOOL)(exp)), #e, __FILE__, __LINE__)
  203. #else /* _DEBUG_ */
  204. #define ASSERT(e)
  205. #endif /* _DEBUG_ */
  206.  
  207. #define display_lock()       EnterCriticalSection(&display_mutex);
  208. #define display_unlock()     LeaveCriticalSection(&display_mutex);
  209. #define rtd_lock(sp)         EnterCriticalSection(&sp->rtd_mutex)
  210. #define rtd_unlock(sp)       LeaveCriticalSection(&sp->rtd_mutex)
  211. #define sat_lock()           EnterCriticalSection(&sat_mutex)
  212. #define sat_unlock()         LeaveCriticalSection(&sat_mutex)
  213.  
  214. /*
  215.  * Default selection attributes
  216.  */
  217. #define    DURATION_DEFAULT        "1.0"        /* 1 day */
  218. #define STEPTIME_DEFAULT        "20"        /* 20 degrees of arc */
  219. #define MINELEVATION_DEFAULT    "0.0"        /* degrees above local horizon */
  220. #define UPDATE_DEFAULT            "30"        /* seconds */
  221.  
  222. #endif /* _VSTDEFS_H */
  223.